<template>
    <!-- component/serviceItem/serviceItem.wxml style-small/style-list -->
    <view :class="'goods-list ' + style">
        <block v-for="(item, idx) in con.RowList" :key="idx">
            <view class="good-inner">
                <navigator class="navi" :url="'/pages/proDetail/proDetail?Ftype=' + Ftype + '&Ftypeid=' + item.Fid" hover-class="none">
                    <view class="activity">
                        <image mode="aspectFit" class="pro_pic" :src="item.Fimg"></image>
                        <view class="activity-info">
                            <text class="activity-desc">{{ Fadesc }}</text>
                            <text class="activity-time" v-if="item.Ftsatus == '0'">{{ item.Fbtime }}开启</text>
                            <text class="activity-time" v-else-if="item.Ftsatus == '2'">已结束</text>
                            <text class="activity-time" v-else-if="item.Ftsatus == '1'">
                                {{ item.obj.day == '00' ? '' : item.obj.day + '天' }}{{ item.obj.hou }}:{{ item.obj.min }}:{{ item.obj.sec }}
                            </text>
                        </view>
                    </view>
                    <view class="goods-desc">
                        <view class="goods-title">{{ item.Fname }}</view>
                        <view v-if="prop.cate_id == '2'" class="activity_group">
                            <view class="progress_sku">
                                <view class="progress" :style="'width:' + item.Fprogress"></view>
                            </view>
                            <view class="max">{{ item.Fprogress }}%</view>
                        </view>
                        <view class="goods-info">
                            <text class="goods-price">
                                <text>￥</text>
                                <text class="good-lowprice">{{ item.Fsaleprice }}</text>
                            </text>
                            <text class="goods-sale">
                                {{ item.Ftype == '3' ? item.Fsalenum + '人拼团' : '已售' + item.Fsalenum }}
                            </text>
                        </view>
                    </view>
                </navigator>
            </view>
        </block>
    </view>
</template>

<script>
// component/serviceItem/serviceItem.js
var util = require('../../utils/util.js');
export default {
    data() {
        return {
            prop: null,
            style: 'style-small',
            Fadesc: '限时特惠',
            Ftype: 4
        };
    },
    /**
     * 组件的属性列表
     */
    props: {
        con: {
            type: Object
        }
    },
    mounted() {
        // 处理小程序 ready 生命周期
        this.$nextTick(() => this.ready());
    },
    /**
     * 组件的方法列表
     */
    methods: {
        ready: function () {
            var that = this;
            var prop = JSON.parse(that.con.prop);
            var con = that.con;
			that.prop = prop;
			that.style = 'style-' + prop.size;
           
            var arr = [];
            if (prop.cate_id == '1')
			{
				that.Fadesc = '限时特惠';
				that.Ftype = 4; 
			}
            else if (prop.cate_id == '2') {
				that.Fadesc = '团购';
				that.Ftype = 5;  
            } else if (prop.cate_id == '3') {
				that.Fadesc = '拼团';
				that.Ftype = 6;   
            }
        },

        link: function (e) {
            // var that = this;
            // var data = e.currentTarget.dataset.info;
            // var url = "";
            // //微页面
            // if (data.Ftype == 4) { //闪购活动
            //   url = "/pages/proDetail/proDetail?Ftype=4&Fid=" + data.Ftypeid;
            // } else if (data.Ftype == 5) { //团购活动
            //   url = "/pages/proDetail/proDetail?Ftype=5&Fid=" + data.Ftypeid;
            // } else if (data.Ftype == 6) { //拼团活动
            //   url = "/pages/proDetail/proDetail?Ftype=6&Fid=" + data.Ftypeid;
            // }
            // uni.navigateTo({
            //   url: url,
            // })
        }
    },
    created: function () {}
};
</script>
<style>
@import './serviceItem.css';
</style>
